<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <meta name="author" content="Flying hormone" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta charset="UTF-8">
        <link rel="stylesheet" href="../css/media.css" />
        <link rel="stylesheet" href="../css/mui.min.css" />
        <link rel="stylesheet" href="../css/head_foot.css" />
        <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="../js/jquery.Query.js" ></script>
        <script type="text/javascript" src="../js/jquery-cookie.js"></script>
        <script type="text/javascript" src="../js/mui.min.js"></script>
        <script type="text/javascript" src="../js/appcan.js"></script>
        <script type="text/javascript" src="../js/appcan.control.js"></script>
        <script type="text/javascript" src="../js/common.js" ></script>
		<title>商品详情</title>
		<style>
            
            .shucailei {
                margin-top: 0.625em;
            }
            
            .shucailei h2 {
                background: #fff;
                color: #666;
                padding: 0.625em;
                font-size: 1em;
                line-height: 1.5em;
                position: relative;
            }
            
            .shucailei h2 span {
                float: right;
            }
            
            .shucailei h2 a {
                float: right;
                color: #666;
            }
            
            .shucailei>p {
                background: #f9efc9;
                text-align: center;
                position: relative;
                line-height: 2em;
            }
            
            .shucailei>p a {
                position: absolute;
                right: 0.3125em;
                color: #ff5256;
            }
            
            .shucailei .i {
                font-style: normal;
                color: #ff3366;
                margin-right: 0.625em;
            }
            
            .shucailei .mui-table-view .mui-media-object {
                max-width: 25%;
                height: auto;
            }
            
            .shucailei .mui-table-view-cell>a:not(.mui-btn) {
                white-space: normal;
            }
            
            .shucailei .mui-ellipsis {
                white-space: normal;
            }
            
            .shucailei .search {
                background: #87d4fe;
                border: none;
                height: 2em;
                position: absolute;
                width: 60%;
                padding: 0;
                margin: 0 auto;
                margin-top: 0.3125em;
                display: block;
                top: 0;
                left: 20%;
            }
            
            .shucailei .search input[type=text] {
                background: none;
                border: none;
                text-indent: 0.625em;
                padding: 0;
                margin: 0;
                height: 1.5em;
                font-size: 1em;
                width: 100%;
                height: 100%;
            }
            
            .shucailei .search img {
                height: 60%;
                position: absolute;
                top: 0.3125em;
                right: 0.3125em;
            }
            .shucailei li{
                padding: 1.25em;
            }
            .mui-media-body{
                font-size: 0.875em;
                padding-right: 2em;
            }
            
            .mui-table-view-cell>a:not(.mui-btn){
                padding: 0;
            }
            .shuoming {
                background: #fff;
            }
            .shuoming h2 {
                color: #666;
                padding: 0.5em;
                font-size: 0.9em;
                line-height: 1.5em;
                position: relative;
            }
            .shuoming div {
                border: 1px solid #666;
                color: #666;
                padding: 0.3em 0.8em;
                margin: 0.3em;
                font-size: 1em;
                line-height: 1.5em;
                position: relative;
            }
        </style>
	</head>

	<body>
		<header>
			<a><span class="leftleft"></span></a>
			<h1 id="typeName">活动详情</h1>
			<a class="xiaoxi2" cardId=''>名片</a>
		</header>
		<div id="infoGoods">
		    <section class="shuoming">
                <!-- <h2>位置：<span id="weizhi"></span></h2> -->
                <div id="neirong"></div>
            </section>
		</div>
		<script>
            var actId = getVal("actId");
            $(function(){
                    //获取数据
                    appcan.ajax({
                        type:"post",
                        url:host+"/getActive.json?actId="+actId,
                        dataType:"json",
                        async:false,    
                        contentType: "application/json",
                        success : function(dataResult) {
                            if(!!dataResult.data){
                                var data = dataResult.data;
                                //$("#weizhi").text(data.region);
                                if(!!data.detailSummary && data.detailSummary.length >0){
                                    $("#neirong").text(data.detailSummary);
                                }else{
                                    $("#neirong").remove();
                                }
                            }
                        }
                    })
                    
                appcan.ajax({
                    type:"post",
                    url:host+"/getActItem.json?actId="+actId+"&limit=5",
                    data:'',
                    dataType:"json",
                    contentType: "application/json",
                    success : function(dataResult) {
                        var dataList = dataResult.data;
                        var itemStr = "";
                        if(dataList.length>0){
                            $(".xiaoxi2").attr("cardId", dataList[0].active.cardId)
                            for(var i=0;i<dataList.length;i++){
                                var active = dataList[i].active;
                                var actType = active.actType.substring(0,1);
                                switch(actType){
                                    case "A":
                                        $("#typeName").text("名优详情");
                                        break;
                                    case "B":
                                        $("#typeName").text("同城购详情");
                                        break;
                                    case "C":
                                        $("#typeName").text("超市详情");
                                        break;
                                    case "D":
                                        $("#typeName").text("母婴详情");
                                        break;
                                    case "E":
                                        $("#typeName").text("车辆详情");
                                        break;
                                    case "F":
                                        $("#typeName").text("房产详情");
                                        break;
                                }
                                var itemList = dataList[i].itemList;
                                itemStr +='<section class="shucailei">';
                                itemStr +='<h2>'+dataList[i].cateName+'<a href="javascript:;" onclick="openUrl(\'goodsList.html?actId='+actId+'&cateId='+dataList[i].cateId+'\',\'goodsList\')">更多</a></h2>';
                                itemStr +='<div><ul class="list_c">'
                                for(var j=0;j<itemList.length;j++){
                                    var yourtime=itemList[j].endTime+" 23:59:59";
                                    yourtime = yourtime.replace("-","/");//替换字符，变成标准格式
                                    var d2=new Date();//取今天的日期
                                    var d1 = new Date(Date.parse(yourtime));
                                    // 未结束 未下架的
                                   if(d1>=d2 && (itemList[j].updateBy.length == 0 || itemList[j].updateBy == "0")){
                                        itemStr +='<li>';
                                        itemStr +='<a href="javascript:;">';
                                        itemStr +='<div>';
                                        itemStr +='<img src="'+hostIp+itemList[j].itemPic+'">';
                                        itemStr +='</div>';
                                        itemStr +='<div>';
                                        itemStr +='品名：'+itemList[j].itemName;
                                        itemStr +='<p><span class="i">特价：'+itemList[j].spePrice+'元/'+itemList[j].speUnit+'</span>原价：<s>'+itemList[j].listPrice+'元/'+itemList[j].listUnit+'</s></p>';
                                        itemStr +='<p>时间：'+itemList[j].startTime+' 至 '+itemList[j].endTime+'</p>';
                                        itemStr +='<p>说明：'+itemList[j].remark+'</p>';
                                        itemStr +='</div>';
                                        itemStr +='</a>';
                                        itemStr +='</li>';
                                   }
                                }
                                itemStr +='</ul></div>';
                                itemStr +='</section>';
                            }
                        }
                        $("#infoGoods").append(itemStr);
                    }
                })
            });
        </script>
	</body>
</html>